package com.kotlin.flong.coroutines

import java.lang.reflect.Executable
import java.util.concurrent.Executor
import java.util.concurrent.Executors
import java.util.concurrent.ForkJoinPool

/**
 * @Author:liangjl
 * @Date: 2020/7/6-22:00
 * @Eamil:jilongliang@sina.com
 * @Description:
 */

fun main() {

    /*var service = Executors.newFixedThreadPool(3)
    var runnable = MyRunable()
    service.execute(runnable)*/

    var service = ForkJoinPool(3)
    var runnable = MyRunable()
    service.execute(runnable)
}

class MyRunable : Runnable {
    override fun run() {
        (1..10).forEach {
            println(it)
            Thread.sleep(500L)
        }
    }

}